package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 
 * @TableName vitamin
 */
@TableName(value ="vitamin")
@Data
public class Vitamin implements Serializable {

    /**
     * 保存水果或者蔬菜的id
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 0为水果/Trace
     */
    @TableField(value = "vitamin_Id")
    private Integer vitaminId;

    /**
     * 脂溶性维生素A
     */
    @TableField(value = "vitamin_A")
    private Double vitaminA;

    /**
     * 水溶性维生素B1
     */
    @TableField(value = "vitamin_B1")
    private Double vitaminB1;

    /**
     * 水溶性维生素B2
     */
    @TableField(value = "vitamin_B2")
    private Double vitaminB2;

    /**
     * 水溶性维生素B12
     */
    @TableField(value = "vitamin_B12")
    private Double vitaminB12;

    /**
     * 水溶性维生素C
     */
    @TableField(value = "vitamin_C")
    private Double vitaminC;

    /**
     * 脂溶性维生素D
     */
    @TableField(value = "vitamin_D")
    private Double vitaminD;

    /**
     * 脂溶性维生素E
     */
    @TableField(value = "vitamin_E")
    private Double vitaminE;

    /**
     * 脂溶性维生素F
     */
    @TableField(value = "vitamin_F")
    private Double vitaminF;

    /**
     * 水溶性维生素烟酸
     */
    @TableField(value = "niacin")
    private Double niacin;

    /**
     * 水溶性维生素叶酸
     */
    @TableField(value = "folicAcid")
    private Double folicAcid;

    /**
     * 创建时间
     */
    @TableField(value = "create_Time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_Time")
    private LocalDateTime updateTime;

    /**
     * 0删除/默认1
     */
    @TableLogic
    @TableField(value = "is_Delete")
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Vitamin other = (Vitamin) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getVitaminId() == null ? other.getVitaminId() == null : this.getVitaminId().equals(other.getVitaminId()))
            && (this.getVitaminA() == null ? other.getVitaminA() == null : this.getVitaminA().equals(other.getVitaminA()))
            && (this.getVitaminB1() == null ? other.getVitaminB1() == null : this.getVitaminB1().equals(other.getVitaminB1()))
            && (this.getVitaminB2() == null ? other.getVitaminB2() == null : this.getVitaminB2().equals(other.getVitaminB2()))
            && (this.getVitaminB12() == null ? other.getVitaminB12() == null : this.getVitaminB12().equals(other.getVitaminB12()))
            && (this.getVitaminC() == null ? other.getVitaminC() == null : this.getVitaminC().equals(other.getVitaminC()))
            && (this.getVitaminD() == null ? other.getVitaminD() == null : this.getVitaminD().equals(other.getVitaminD()))
            && (this.getVitaminE() == null ? other.getVitaminE() == null : this.getVitaminE().equals(other.getVitaminE()))
            && (this.getVitaminF() == null ? other.getVitaminF() == null : this.getVitaminF().equals(other.getVitaminF()))
            && (this.getNiacin() == null ? other.getNiacin() == null : this.getNiacin().equals(other.getNiacin()))
            && (this.getFolicAcid() == null ? other.getFolicAcid() == null : this.getFolicAcid().equals(other.getFolicAcid()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getVitaminId() == null) ? 0 : getVitaminId().hashCode());
        result = prime * result + ((getVitaminA() == null) ? 0 : getVitaminA().hashCode());
        result = prime * result + ((getVitaminB1() == null) ? 0 : getVitaminB1().hashCode());
        result = prime * result + ((getVitaminB2() == null) ? 0 : getVitaminB2().hashCode());
        result = prime * result + ((getVitaminB12() == null) ? 0 : getVitaminB12().hashCode());
        result = prime * result + ((getVitaminC() == null) ? 0 : getVitaminC().hashCode());
        result = prime * result + ((getVitaminD() == null) ? 0 : getVitaminD().hashCode());
        result = prime * result + ((getVitaminE() == null) ? 0 : getVitaminE().hashCode());
        result = prime * result + ((getVitaminF() == null) ? 0 : getVitaminF().hashCode());
        result = prime * result + ((getNiacin() == null) ? 0 : getNiacin().hashCode());
        result = prime * result + ((getFolicAcid() == null) ? 0 : getFolicAcid().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", vitaminId=").append(vitaminId);
        sb.append(", vitaminA=").append(vitaminA);
        sb.append(", vitaminB1=").append(vitaminB1);
        sb.append(", vitaminB2=").append(vitaminB2);
        sb.append(", vitaminB12=").append(vitaminB12);
        sb.append(", vitaminC=").append(vitaminC);
        sb.append(", vitaminD=").append(vitaminD);
        sb.append(", vitaminE=").append(vitaminE);
        sb.append(", vitaminF=").append(vitaminF);
        sb.append(", niacin=").append(niacin);
        sb.append(", folicacid=").append(folicAcid);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}